using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Multivariate
{
    /// <summary>
    /// <para>Dendrogram</para>
    /// <para>Constructs a tree diagram (dendrogram) showing attribute distances between sequentially merged classes in a signature file.</para>
    /// <para>构造树形图（树状图），显示特征文件中按顺序合并的类之间的属性距离。</para>
    /// </summary>    
    [DisplayName("Dendrogram")]
    public class Dendrogram : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Dendrogram()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_signature_file">
        /// <para>Input signature file</para>
        /// <para><xdoc>
        ///   <para>Input signature file whose class signatures are used to produce a dendrogram.</para>
        ///   <para>A .gsg extension is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入签名文件，其类签名用于生成树状图。</para>
        ///   <para>需要 .gsg 扩展名。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_dendrogram_file">
        /// <para>Output dendrogram file</para>
        /// <para><xdoc>
        ///   <para>The output dendrogram ASCII file.</para>
        ///   <para>The extension can be .txt or .asc.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出树状图 ASCII 文件。</para>
        ///   <para>扩展名可以是 .txt 或 .asc。</para>
        /// </xdoc></para>
        /// </param>
        public Dendrogram(object _in_signature_file, object _out_dendrogram_file)
        {
            this._in_signature_file = _in_signature_file;
            this._out_dendrogram_file = _out_dendrogram_file;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Dendrogram";

        public override string CallName => "sa.Dendrogram";

        public override List<string> AcceptEnvironments => ["scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_signature_file, _out_dendrogram_file, _distance_calculation.GetGPValue(), _line_width];

        /// <summary>
        /// <para>Input signature file</para>
        /// <para><xdoc>
        ///   <para>Input signature file whose class signatures are used to produce a dendrogram.</para>
        ///   <para>A .gsg extension is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入签名文件，其类签名用于生成树状图。</para>
        ///   <para>需要 .gsg 扩展名。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input signature file")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_signature_file { get; set; }


        /// <summary>
        /// <para>Output dendrogram file</para>
        /// <para><xdoc>
        ///   <para>The output dendrogram ASCII file.</para>
        ///   <para>The extension can be .txt or .asc.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出树状图 ASCII 文件。</para>
        ///   <para>扩展名可以是 .txt 或 .asc。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output dendrogram file")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_dendrogram_file { get; set; }


        /// <summary>
        /// <para>Use variance in distance calculations</para>
        /// <para><xdoc>
        ///   <para>Specifies the manner in which the distances between classes in multidimensional attribute space are defined.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The distances between classes will be computed based on the variances and the Euclidean distance between the means of their signatures.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The distances between classes will be determined by the Euclidean distances between the means of the class signatures only.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定定义多维属性空间中类之间的距离的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 类之间的距离将根据方差和其特征均值之间的欧几里得距离进行计算。</bullet_item><para/>
        ///     <bullet_item>未选中—类之间的距离将仅由类签名均值之间的欧几里得距离确定。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use variance in distance calculations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distance_calculation_value _distance_calculation { get; set; } = _distance_calculation_value._true;

        public enum _distance_calculation_value
        {
            /// <summary>
            /// <para>VARIANCE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("VARIANCE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>MEAN_ONLY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MEAN_ONLY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Line width of dendrogram</para>
        /// <para><xdoc>
        ///   <para>Sets the width of the dendrogram in number of characters on a line.</para>
        ///   <para>The default is 78.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>设置树状图的宽度（以行上的字符数表示）。</para>
        ///   <para>默认值为 78。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line width of dendrogram")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _line_width { get; set; } = 78;


        public Dendrogram SetEnv(object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}